package com.quick.im.server;


import com.quick.im.server.component.NettyServerConfig;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class ServerApplication {
    public static void main(String[] args) {
        SpringApplication.run(ServerApplication.class, args);
    }

    @Bean
    public CommandLineRunner run(NettyServerConfig nettyServerConfig) {
        return args -> {
            System.out.println("Starting Netty Server...");
            nettyServerConfig.start();  // 启动服务器
        };
    }
}